import React, { Component } from 'react';
import connect from './connect';
@connect
class index extends Component {
    render() {
        console.log(this.props);
        return (
            <div>
                <p>
                    姓名: <input type="text" value={this.props.username} onChange={e => this.props.filmLoginUser(e)} />
                </p>
                <p>
                    密码: <input type="password" value={this.props.password} onChange={e => this.props.filmLoginPwd(e)} />
                </p>
                <button onClick={e => {
                    this.props.filmLogin({
                        username: this.props.username,
                        password: this.props.password
                    })
                    this.props.history.push('/home/films/list')
                }}>登录</button>
            </div>
        );
    }
}

export default index;
